use Test::More qw/no_plan/;
use Cwd;
use FindBin;
use lib Cwd::abs_path("$FindBin::Bin/../../../../lib");
use lib Cwd::abs_path("$FindBin::Bin/../../../../generate/MyProject/lib");
use strict;
use warnings;

use MyProject;
=head
ok my $proj = 'MyProject';
ok my $os = $proj->OS;


#setup
$os->system('perl %path/apps/Tool/run.pl generate CmdApp MyCmdTest', $proj->project_root);

my $DTP = qr/\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\(\d+\)/;

{ #run
    is $proj->qx('%path/run.pl /x/args X=1 Y=0 Z', "$apps/BT"), '[#] X::args 開始
[O] {X=>1,Y=>0,Z=>1}
[#] X::args 終了
 
';
    
    my $log = $proj->config->log_dir.'/'.$proj->now->ymd."_X_Args.log";
    $os->cat(my $buf, '<', $log);
    like $buf, qr/^\[#\] $DTP X::Args 開始
\[O\] $DTP {X=>1,Y=>0,Z=>1}
\[#\] $DTP X::Args 終了
 
\z/;
    $proj->unlink($log);
}
=cut

package Capture;
sub TIEHANDLE { bless \(my $buf = ''), shift }
sub PRINT { ${+shift} .= shift }
